﻿#pragma warning disable SA1636 // File header copyright text should match

// <copyright file="MeterFactoryBase.cs" company="OpenTelemetry Authors">
// Copyright 2018, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
#pragma warning restore SA1636 // File header copyright text should match

using System;

namespace Steeltoe.Management.OpenTelemetry.Metrics
{
    /// <summary>
    /// Creates Meters for an instrumentation library.
    /// </summary>
    [Obsolete("OpenTelemetry Metrics API is not considered stable yet, see https://github.com/SteeltoeOSS/Steeltoe/issues/711 more information")]
    public class MeterFactoryBase
    {
        private static readonly NoOpMeter _noOpMeter = new ();

        /// <summary>
        /// Gets the dafult instance of a <see cref="MeterFactoryBase"/>.
        /// </summary>
        public static MeterFactoryBase Default { get; } = new ();

        /// <summary>
        /// Returns an IMeter for a given name and version.
        /// </summary>
        /// <param name="name">Name of the instrumentation library.</param>
        /// <param name="version">Version of the instrumentation library (optional).</param>
        /// <returns>Meter with the given component name and version.</returns>
        public virtual Meter GetMeter(string name, string version = null) => _noOpMeter;
    }
}
